home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / umich / diskutil / bfrd_10.zoo / bfrd.doc next >
Encoding:
Text File  |  1993-07-23  |  14.8 KB  |  240 lines

  1.  **************************************************************************
  2.  *                                                                        *
  3.  *             BU_BFRD.PRG & RES_BFRD.PRG  -   (Version 1.0)              *
  4.  *             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~              *
  5.  *                                                                        *
  6.  *       BOOTSECTOR, FATS & ROOTDIRECTORY BACKUP & RESTORE UTILITIES      *
  7.  *                                                                        *
  8.  *      ( upgrade to BFRDBU.PRG v_1.0, distributed as BFRDBU10.ZOO )      *
  9.  *                                                                        *
  10.  *   Author:    W. Alan B. Evans, University of Kent, Canterbury, UK.     *
  11.  *                                                                        *
  12.  *  (These Programs must NOT be sold commercially without the Author's    *
  13.  *  Permission. FREE Distribution is allowed on condition that the        *
  14.  *  the documentation File, BFRD.DOC, always accompanies the programs)    *
  15.  *                                                                        *
  16.  *   ( WARNING!! These disk utility programs can seriously damage         *
  17.  *    Disk Structures if used incorrectly. It is hereby understood        *
  18.  *    that THESE PROGRAMS ARE USED ENTIRELY AT THE USER'S RISK, and       *
  19.  *    the Author will in NO WAY be responsible for any such damage        *
  20.  *    howsoever caused.                wabe@ukc.ac.uk     July 1993 )     *
  21.  *                                                                        *
  22.  **************************************************************************
  23.  
  24.  
  25. Preamble
  26. ~~~~~~~~
  27.      A few years ago, I had Hard Disk Troubles of the kind that led to
  28. the FATS and ROOTDIRECTORY info on my SH205 being frequently
  29. over-written.  This of course results in making the files on that
  30. partition, though largely undamaged, virtually inaccessible.  In an
  31. ideal world this should NEVER happen but imperfect hardware, software
  32. and/or human error not to mention human sabotage (malignant FAT-eating
  33. viruses!) can lead to this disastrous situation.  As a cure, I
  34. initially wrote a Hard Disk backup program HDQBUR - "Hard Disk Quick
  35. Backup & Restore" which was distributed to the Archives in the past as
  36. part of HD_UTILS).  This has since evolved to VTABU - "the Volume
  37. Transferor and Backer-Upper" (not distributed) which enables tha saved
  38. sector-copy of a partition to be restored to a differently (but
  39. adequately!) sized partition on (perhaps) a new Hard Disk.  Whilst a
  40. "full" backup of this kind is fine, the fact is that it takes quite a
  41. long time and rather many disk swaps to even back-up a single,
  42. relatively-full 16 Mbyte partition that it tends not to get done very
  43. often.  I eventually realised that what I really needed was an utility
  44. that simply copied the FATS and ROOTDIRECTORY Info on a selected
  45. Partition to file (stored on floppy or, perhaps, on another
  46. Partition).  This of course is quick and can be done daily or even
  47. every time you boot up.  Then if a subsequent disaster occurs this
  48. info can be restored and thus access is regained to the locations of
  49. ALL rootdirectory files (and directories) that have NOT been altered
  50. since the last backup - provided, of course, they are undamaged by the
  51. initial disaster!!.  However new files you may have created or files
  52. that have been edited since the last backup will of course be lost or
  53. "uncomplete".  But often this is not so bad as they tend to be fresh
  54. in your mind and are usually fairly easily redeemable from some other
  55. source (e.g.  floppy copy etc.).  After "restoring" such Partitions it
  56. is advisable to check its FATS' integrity with some suitable Utility
  57. such as ICD's "CLEANUP" (which I personally find excellent) or, maybe,
  58. with Jorge Lohse's FSCK.PRG (though this is old and works only on
  59. non-extended {<= 16 Mbyte} and non-BGM partitions) or with other more
  60. recent disk-tools that I've heard of but never tried.  Most imperfect
  61. files can be "weeded-out" this way.
  62.  
  63.     Thus BFRDBU.PRG (already distributed to Atari Archive) came to
  64. be - and during the past few years, has saved me a great deal of
  65. trouble, alas on several occasions.  The current offering, BU_BFRD.PRG
  66. & RES_BFRD.PRG, is an upgrade on that in the sense that in the tiny
  67. BACKUP_ONLY program, BU_BFRD.PRG, I have implemented the "quick"
  68. cyclic backing of all partitions on "other" partitions (see below)
  69. that I mentioned in the documentation (BFRDBU.DOC) that accompanied
  70. the earlier version and which, indeed, I first thought of when writing
  71. that DOC.  This improvement reduced the total time to back-up ALL
  72. partitions on my 105 Mbyte Hard Disk to only 9 secs from the 65 secs
  73. or so it took to back them onto floppy.  Of course, this program is
  74. ideal as an AUTO-folder back-up program (it uses no GEM).
  75. RES_BFRD.PRG is similar to BFRDBU.PRG in that it restores and
  76. back-ups, but now with the option of which directory to store the
  77. backup files ( instead of invariably in floppy drive A: ).  It also
  78. has several other minor improvements.  Like the earlier BFRDBU,
  79. RES_BFRD uses GEM only in its "restore" option, and so could in
  80. principle be used as an AUTO folder program for back-ups only.  For
  81. instance, you would do this should you wish all your backup files to
  82. go to a single directory (e.g.  A: ).
  83.  
  84.     Of course, these programs also serve as a protection against
  85. accidental "human" FAT corruption as well as FAT corruption due to
  86. faulty Hardware and/or Software.  Such a situation could arise (as it
  87. did ONCE for me) when I wished to delete all files in a subdirectory
  88. and so (from GULAM) I typed " rm * ".  Yes, you've guessed it - I had
  89. forgotten I'd just changed directory to the root D:\ and GULAM
  90. proceeded to delete ALL files in D:\ - or would have done had I not
  91. hit the warm reset button in panic.  As it happened, I had a fairly
  92. recent FAT backup of D:\, and catastrophe was averted by restoring that
  93. - though I blush to admit that I spent about half an hour with a file
  94. UNDELETING tool ( Simon Poole's DLII.PRG) before it became apparent
  95. that this tool (as would all "undeleting" tools I think) was proving
  96. ineffective (as so many deleted files were fragmented) before the
  97. above-mentioned "obvious" solution hit me!
  98.  
  99.  
  100. BU_BFRD.PRG - The back-up program - suitable for AUTO folder use.
  101. ~~~~~~~~~~~
  102.     BU_BFRD will save the Bootsector-Fats-Rootdirectory Info on
  103. selected partitions (or Volumes) into .FBU (Fats Back-Up) files such
  104. as C_BFRD.FBU, .., E_BFRD.FBU that must be saved to "other" (i.e.
  105. distinct) Hard Disk Partitions.  It would, of course, be silly to save
  106. C_BFRD.FBU to a file on drive C:\ since it could not be found if C:\'s
  107. FATS became corrupt!!.  Saving to Hard Disk (as compared with saving
  108. to floppy) makes the backing up process extremely quick.  As mentioned
  109. above I now regularly back-up all my C:\,D:\,E:\ and F:\ partitions on
  110. my ICD 105 Mbyte Hard disk in about 9 seconds when I boot up.  So, to
  111. set-up, you must decide a suitable permutation of partitions onto
  112. which to write each partition's backup file.  A viable permutation
  113. would be to save these .FBU files to different partitions cyclically -
  114. e.g.  if you have Partitions C:\, D:\ and E:\, then save C_BFRD.FBU to
  115. D:\, D_BFRD.FBU to E:\ and E_BFRD.FBU to C:\.  As currently configured
  116. you MUST save your LAST Hard Disk Partition onto drive C:\.  If this
  117. is F:\ (say) then, to initialise things, you should copy a dummy file
  118. (any old file will do - it'll soon be deleted and replaced) to C:\ and
  119. name it F_BFRD.FBU.  The first letter (F) of this filename tells
  120. BU_BFRD how many Hard Disk Partitions exist (nb.  the presence of
  121. RAMDISKS could otherwise complicate matters if you were to try to
  122. determine this with the Drvmap() function).  You must also copy dummy
  123. files to D:\, E:\ and F:\ and name them similarly - the first letter
  124. of each filename signifying which drive's ROOTDIRECTORY & FATS info is
  125. to be saved to these partitions.  Personally I followed the cyclic
  126. permutation convention - so I named these to C_BFRD.FBU on D:\,
  127. D_BFRD.FBU on E:\ and E_BFRD.FBU on F:\ - but you could permute these
  128. names subject to the constraint that F_BFRD.FBU must remain on C:\.
  129. Having set these dummy files, run BU_BFRD.PRG and answer [y]es to the
  130. prompt, and your dummy files will be replaced by the proper
  131. FAT/ROOTDIRECTORY backups in about 10 seconds or less (assuming you
  132. have TOS >= 1.04 ; earlier TOSes had an inefficient File writing
  133. algorithm and filewriting takes longer).  Then put BU_BFRD.PRG in your
  134. AUTO folder and, every time you boot, you will then have the choice to
  135. update your back-ups.  Note both BU_BFRD and RES_BFRD do check on each
  136. partition's logical sector size so that they can safely be used with
  137. BGM Partitions etc.  (I have been doing so for years!).
  138.  
  139.  
  140. RES_BFRD.PRG - The Restore (and, optionally, backup) program
  141. ~~~~~~~~~~~~
  142.     This program is the one to restore the FAT\ROOTDIRECTORY
  143. information should a disaster occur.  It does also have the ability to
  144. backup partitions to a specified directory (e.g.  A: or D:\BACKS etc. )
  145. in the which case ALL your back-up files will go to this directory.
  146. Generally speaking, it is not wise to place these in a "vulnerable"
  147. hard disk partition except that so many hard disks now have "removable
  148. inserts" or "flopticals" if you like.  In this sense, RES_BFRD.PRG is
  149. self-contained i.e.  should really be called RESBU_BFRD.PRG (restore
  150. and back-up) - but I'm sure most will find BU_BFRD more convenient to
  151. back-up from the AUTO folder, and so I guess RES_BFRD's back-up option
  152. will be little used.  The selection of drives (which could be Floppy
  153. drives or RAMDISKS as well as Hard Disk Partitions) to be backed is
  154. done simply by entering a string e.g.  "CEF" (case or order does not
  155. matter) which is made up of the Drive Letters of all selected drives
  156. i.e.  in this example you would be selecting Partitions C:\, E:\ and
  157. F:\ (note here you need not back up ALL partitions; nor, indeed, do you
  158. have to with BU_BFRD - for if there is no filename X_BFRD.FBU on any
  159. partition then drive X will not be backed).  The BACKUP option of
  160. RES_BFRD does not use any GEM and so "could", if desired, be used as
  161. an AUTO-folder program at booting-up time.  However, for the RESTORE
  162. option I thought it convenient to have some FormAlerts and the GEM
  163. FileSelector so that this (hopefully rarely needed) option must be
  164. done after boot-up within the GEM/AES environment.  No elaborate
  165. explanations are needed here - RES_BFRD will prompt you with simple
  166. questions at each stage. Finally I should mention that RST_BFRD is
  167. packed with the (MINT compatible) ICE v_2.4 packer which reduces it
  168. from 10 to 6 kbytes or so.
  169.  
  170.     After a partition is restored I have NOT FORCED a reset
  171. (STMIROR2 for example forces a COLD reset - which of course would
  172. destroy any RAMDISKs you may have loaded).  Instead, after a
  173. "restore", RES_BFRD displays an alert inviting you to do a WARM reset
  174. (preserves reset-survivable ramdisks) with the option of coming out
  175. without doing a reset at all.  This is in recognition of the fact that
  176. there is software about today that can force TOS to update its buffer
  177. information on a selected drive e.g.  Charles F.  Johnson's excellent
  178. "Little Green Fileselector" LGSELECT will do this task if you click on
  179. a drive icon whilst pressing down either of the SHIFT keys.  If I knew
  180. how this is done I'd code it in so that the question of a reset would
  181. not arise.  My Mark Williams C Manual gives no info on how to force a
  182. media change ( so if anyone can tell me the trick .....  ).  Anyway,
  183. if you are in doubt, THEN ALWAYS SELECT A WARM RESET AFTER A RESTORE
  184. or be sure to do one fairly soon after BEFORE ANY WRITES TO THE
  185. RESTORED PARTITION ARE MADE.  It is possible to incur serious file
  186. damage if you write to a restored partition without updating TOS on
  187. the changes you've made (behind it's back).  It seems to be (though I
  188. could be wrong here) that if you have not opened any subdirectories on
  189. the damaged partition prior to the "restore", then you are fairly safe
  190. - but DON'T TAKE MY WORD ON THIS - IF THE CONTENTS ARE IMPORTANT -
  191. PLAY SAFE AND DO A WARM RESET.
  192.  
  193. SOME HISTORY
  194. ~~~~~~~~~~~~
  195.     I recently discovered, that this useful idea of saving the FAT
  196. and ROOTDIRECTORY Info - which I implemented in about 1989, was also
  197. independently implemented at about that time (or earlier) by Michael
  198. J.  Mitchell of Catspaw Software Systems in the release of his
  199. STMIRROR program.  I downloaded STMIROR2.PRG (Version 2 of this) from
  200. a.a.  a few days ago (July 20th 1993) and discovered it does much the
  201. same task as RES_BFRD detailed above.  STMIROR2 is a very elegant,
  202. user-friendly GEM Program with an elaborate Menu.  Unfortunately, this
  203. very elegance means it cannot be used from the AUTO folder.  Further,
  204. it has to be used repeatedly to save info on multiple partitions.  The
  205. same idea also is one of the "most hailed" features of the recent
  206. (and, by all accounts, quite comprehensive) commercial Disk Utility
  207. Program "Diamond Edge" developed by Bob Luneski et al of Oregon
  208. Research (the UK importers are Hisoft).  If what I infer from reading
  209. an article about it in "ST Applications" is correct, I think "Diamond
  210. Edge" (in its "Mirror-backup" option) is very similar to STMIROR2 and
  211. BU_BFRD (except I think it stores all the info in one predetermined
  212. directory) and appears to go one step further than either BU_BFRD or
  213. STMIROR2 in that it will also save info recursively on all the
  214. subdirectories ( but as I've no personal experience of Diamond Edge
  215. cannot be certain of this).  Of course, this will take that much
  216. longer time but still, by all accounts, is fast enough not to deter
  217. one from backing up daily.  I had for a long time toyed with adding
  218. this feature but, as it involved quite a lot of additional coding,
  219. increases the backing-up time, and also since I've never, personally,
  220. experienced or heard of an accident where BOTH subdirectory AND
  221. rootdirectory contents were simultaneously damaged but with virtually
  222. all the files intact, I never did get down to doing it.  Likewise I
  223. trust that most potential users of BU_BFRD will similarly be lucky and
  224. not need full subdirectory backups.  On this point it should help a
  225. little if you ensure that the FIRST file on your disk (that follows
  226. immediately after the rootdirectory ends) is NOT a subdirecory but,
  227. preferably, some large, static and easily- replaced program e.g.
  228. CALAMUS.PRG or similar.  Then if sectors near the top of the
  229. rootdirectory are damaged (by Hardware Faults), no subdirectory
  230. sectors will then be "nearby" on the disk and hopefully they'll stay
  231. undamaged.
  232.  
  233.     Of course, it cannot be emphasized enough that NONE of these
  234. "quick" options is a substitute for a "full" backup - but they DO save
  235. the day in situations where the FATS have been damaged but the files
  236. are intact.
  237.  
  238. Good Luck,
  239. W. Alan B. Evans.                    July 1993.
  240.